package com.sc.service.member;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sc.dal.mapper.member.CaptchaMapper;
import com.sc.dal.model.member.Captcha;
/**
 * 
 * <h1>验证码的业务逻辑层</h1> 
 * 
 * @author xujunbao 
 * @version CaptchaService.java,v0.1 2017年3月3日 下午2:15:14 xujunbao Exp  
 *
 */
@Service
public class CaptchaService {
	@Autowired
	private CaptchaMapper captchaMapper;
	public int insertSelective(Captcha captcha){
		return captchaMapper.insertSelective(captcha);
	}
	public Captcha selectByPhone(String mPhone) {
		List<Captcha> list=captchaMapper.selectByPhone(mPhone);
		if(list!=null&&list.size()>0){
			return list.get(list.size()-1);
		}
		return null;
	}
}
